/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2018-7-24
*
\*********************************************************************/

#ifndef COMMBASE_H
#define COMMBASE_H

#include<functional>

class CommBase
{
public:
    virtual int Send(const unsigned char *sendBuf, const int dataLen) = 0;
    virtual int ReadAndParse() = 0;
    virtual bool Open() = 0;
    virtual void Close() = 0;
    virtual ~CommBase()
    {
        printf("CommBase derived() is called!\n");
    }
    std::function<void(unsigned char* data,int nLength)> ExtractFun = nullptr;
protected:
    virtual int Read(unsigned char * readbuf, const int dataLen) = 0;
};

#endif // COMMBASE_H

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/
